home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_DBROWS.TXT < prev    next >
Encoding:
Text File  |  1992-12-22  |  5.4 KB  |  133 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:DBrowse class structure:
  5. Class DBrowse:
  6. ~~~~~~~~~~~~~~
  7. Class Browse is adapted for database editation. It could be more database
  8. files with relations (conectedd through relations).
  9.  
  10.  
  11. Common use:
  12. ~~~~~~~~~~~
  13. LOCAL OBJECT Db OF DBrowse                  //object creation
  14. NET USE Personal                            //database opening
  15. Db:Init()                                   //object initialisation
  16. Db:AddBlock(,"Meno",,FieldBlock("Meno"))    //field is appended for editation
  17. Db:AddBlock(,"Plat",,FieldBlock("Plat"))    //field is appended for editation
  18.  
  19.  
  20. As all classes derived from Task, this class don't need processing of methods
  21. Process() and Done(). Initialisation adds a new object of this class on the
  22. top of the stack of classes, and following is a job for task swapper
  23. (method Process() of class Task.)
  24.  
  25. Source code of class DBrowse is in  C_DBrows.prg
  26.  
  27. !seealso: c_browse.ngo:Browse c_abrows.ngo:ABrowse c_updbro.ngo:UpDBrowse c_upabro.ngo:UpABrowse c_task.ngo:Task c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  28.  
  29. !short:~~~~~~~~~~~~~~~~~~~~~~~~
  30. !short:create class DBrowse from Browse
  31. !short:  export:
  32. !short:    var Alias      //""
  33. ^BDBrowse:Alias^N: public: character
  34.   Stored Alias workarea, which should be selected when the task is active.
  35.  
  36. !short:    var RecNo      //0
  37. ^BDBrowse:RecNo^N: public: numeric
  38.   Database record number for this task is stored here. It is because
  39.   the other task can during its activity process the command Skip ÒN and
  40.   change the selected record of this database. If RecNo==0, after the task
  41.   switching is command Go TOP issued.
  42.  
  43. !short:    var IndexNo    //0
  44. ^BDBrowse:IndexNo^N: public: numeric
  45.   The same as the DBrowse:RecNo, other task can use anything included the
  46.   command SET ORDER.
  47.   Attention:
  48.   No other task exept the methods of class Task should open or close the
  49.   databases. All methods of the library Object.lib assume that at start
  50.   the databases will be opened and closed at the end.
  51.  
  52. !short:    var FilterNo   //0
  53. ^BDBrowse:FilterNo^N: public: numeric
  54.   Information about the filter number (as order number in user defined
  55.   filters (in menu) ), which is written to bottom window border.
  56.  
  57. !short:    var FilterExp  //""
  58. ^BDBrowse:FilterExp^N: public: numeric
  59.   Active filter of selected database of current task (DBrowse:Alias)
  60.   is saved here.
  61.  
  62. !short:    var FilterBExp //{||false}
  63. ^BDBrowse:FilterBExp^N: public: code_block
  64.   If variable FilterExp is not empty (i.e. it contains a valid clipper
  65.   expression in a for of a text string), so the FilterBExp contais this
  66.   expression transformed to form of code block. The reason for this
  67.   is the evaluation speed of the expression.
  68.  
  69. !short:    var FilterMark //false
  70. ^BDBrowse:FilterMark^N: public: :public: logical
  71.   Checkmark of filter type (true = coloring, false = dismissing).
  72.  
  73. !short:    var OneDbf     //(object of OneDbf)
  74. ^BDBrowse:OneDbf^N: public: object_of_OneDbf
  75.   This object contain index, filter & relations definitions.
  76.   See the OneDbf class.
  77.  
  78. !short:    method New=DBrowseNew                 //o:New() --> self
  79. ^BDBrowse:New()^N: public: return self
  80.   The object is filled with default values, the following predcessor
  81.   variables are changed:
  82.  
  83.   ^UDBrowse:InsBlock^N: public: code_block
  84.     Code block for one row appending to edited table.
  85.  
  86.   ^UDBrowse:DelBlock^N: public: code_block
  87.     Code block for deleting of current row of edited table.
  88.  
  89.   ^UDBrowse:InfoBlock^N: public: code_block
  90.     Code block for actual record number, filter and index displaying at the
  91.     bottom window border of current task.
  92.  
  93. !short:    method DoGet=DBrowseDoGet             //o:DoGet() --> true/false
  94. ^BDBrowse:DoGet()^N: private: return true/false
  95.   The method DoGet() of DBrowse class is appended with the virtual record
  96.   management and relations keeping. Look at method TestVrecord() of Browse
  97.   class.
  98.  
  99. !short:    method PostInit=DBrowsePostInit       //o:PostInit() --> true
  100. ^BDBrowse:PostInit()^N: private: return true
  101.   Used for correct window dimensions counting in the Form mode.
  102.   The DoGet() method of Browse class is appended with filling of instvar
  103.   variable DBrowse:Alias with the value returned from clipper function
  104.   Alias(), when it was not entered (was Empty()).
  105.  
  106. !short:    method SwapForm=DBrowseSwapForm       //o:SwapForm() --> true
  107. ^BDBrowse:SwapForm()^N: private: return true
  108.   It is for speed optimalization, the filter setting is not necessary
  109.   everytime.
  110.  
  111. !short:    method UpDatabase=DBrowseUpDatabase   //o:UpDatabase() --> true
  112. ^BDBrowse:UpDatabase()^N: private: return true
  113.   The clipper DbfNtx system is set correctly for this task, the right
  114.   workarea is selected, index, filter and relationskeeping is done
  115.   and the right database record is jumped to in all necessary database
  116.   files.
  117.  
  118. !short:    method UpFilter=DBrowseUpFilter       //o:UpFilter() --> true
  119. ^BDBrowse:UpFilter()^N: private: return true
  120.   Help method for DBrowse:UpDatabase(). The filter is set.
  121.  
  122. !short:    method VPaint=DBrowseVPaint           //o:VPaint() --> true
  123. ^BDBrowse:VPaint()^N: private: return true
  124.   The parent method is appended with database switching.
  125.  
  126. !short:    method VProcess=DBrowseVProcess       //o:VProcess() --> true
  127. ^BDBrowse:VProcess()^N: private: return true
  128.   The parent method is appended with database switching before the proces
  129.   and currend record number keeping after the process.
  130.  
  131. !short:    endclass
  132.  
  133.